var e = require("../observer"), t = require("./themeModel");

module.exports = Behavior({
    data: {
        themeStyle: null,
        themeBaseColor: "#ffffff"
    },
    attached: function() {
        e.addNotice("kNoticeVi", function(e) {
            this.setThemeStyle(e);
        }.bind(this));
        var o = t.get();
        (o.themeBaseColor || o.subColor) && this.setThemeStyle(o);
    },
    detached: function() {
        e.removeNotice("kNoticeVi");
    },
    methods: {
        setThemeStyle: function(e) {
            var t = e.themeBaseColor, o = e.subColor;
            this.setData({
                themeBaseColor: t,
                themeStyle: "\n          --themeBaseColor: ".concat(t, ";\n          --sub-color: ").concat(o, ";\n        ")
            });
        }
    }
});